home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 2 / ETO Development Tools 2.iso / Tools - Objects / MacApp / MacApp CD Release / MacApp® 2.0.1 Tutorial / Chapter 11 / IconEdit.r next >
Encoding:
Text File  |  1990-10-25  |  5.0 KB  |  171 lines  |  [TEXT/MPS ]

  1. /*********************************************************************************/
  2. /* IconEdit.r                                                                     */
  3. /*                                                                                 */
  4. /* Copyright © 1989 Apple Computer, Inc.  All rights reserved.                       */
  5. /*                                                                                  */
  6. /*********************************************************************************/
  7.  
  8. /* ==============================   Includes   ================================= */
  9.  
  10. #ifndef _TYPES.R_
  11. #include "Types.r"
  12. #endif
  13.  
  14. #ifndef _MacAppTypes_
  15. #include "MacAppTypes.r"
  16. #endif
  17.  
  18. #ifndef __ViewTypes__
  19. #include "ViewTypes.r"
  20. #endif
  21.  
  22. #if qDebug
  23. include "Debug.rsrc";
  24. #endif
  25. include "MacApp.rsrc";
  26.  
  27. include "IconEdit" 'CODE';
  28.  
  29.  
  30. /* ==============================   Constants   ================================ */
  31.  
  32. #define kSeedIconId            1000
  33.  
  34. #define kIconWindowId        1000
  35.  
  36. #define kIconWindowId        1000
  37. #define kIconViewId            1001
  38.  
  39. #define kIconViewHeight        32 * 7 + 10     /* 7 times actual size, 5 pixel borders */
  40. #define kIconViewWidth        32 * 7 + 10     /* 7 times actual size, 5 pixel borders */
  41.  
  42. #define kIconWindowHeight    kIconViewHeight + kSBarSizeMinus1
  43. #define kIconWindowWidth    kIconViewWidth + kSBarSizeMinus1
  44.  
  45.  
  46.  
  47. /* ==============================   Seed Icon   ================================ */
  48.  
  49. resource 'ICON' (kSeedIconId, purgeable) {
  50.     $"0001 0000 0002 8000 0004 4000 0008 2000 0010 1000 0020 0800 0040 0400 0080 0200"
  51.     $"0100 0100 0200 0080 0400 0040 0800 0020 1000 0010 2000 0008 4000 3F04 8000 4082"
  52.     $"4000 8041 2001 3022 1001 C814 080E 7F8F 0402 3007 0201 0007 0100 8007 0080 6007"
  53.     $"0040 1FE7 0020 021F 0010 0407 0008 0800 0004 1000 0002 2000 0001 4000 0000 8000"
  54. };
  55.  
  56.  
  57.  
  58.  
  59. /* =============================   Icon Window   =============================== */
  60.  
  61. resource 'view' (kIconWindowId, purgeable) {
  62.     {
  63.         root, 'WIND', { 50, 20 }, { kIconWindowHeight, kIconWindowWidth },
  64.         sizeVariable, sizeVariable, shown, enabled,
  65.         Window        { "", zoomDocProc, goAwayBox, resizable, modeless,
  66.                           ignoreFirstClick, freeOnClosing, disposeOnFree, closesDocument,
  67.                           openWithDocument, dontAdaptToScreen, stagger, forceOnScreen,
  68.                           dontCenter, noID, "" };
  69.                     
  70.         'WIND',  'SCLR',    { 0, 0 },
  71.         { kIconWindowHeight-kSBarSizeMinus1, kIconWindowWidth-kSBarSizeMinus1 },
  72.         sizeRelSuperView, sizeRelSuperView, shown, enabled,
  73.         Scroller    { "", vertScrollBar, horzScrollBar, 0, 0, 16, 16,
  74.                           vertConstrain, horzConstrain, { 0, 0, 0, 0 } };
  75.  
  76.         'SCLR', IncludeViews    { kIconViewId }
  77.     }
  78. };
  79.  
  80. resource 'view' (kIconViewId, purgeable) {
  81.     {
  82.         root, 'ICON', { 0, 0 }, { kIconViewHeight, kIconViewWidth },
  83.         sizeVariable, sizeVariable, shown, enabled,
  84.         View        { "TIconView"}
  85.     }
  86. };
  87.  
  88.  
  89. /* NOTE: if you used ViewEdit, then replace the above 'view' resources with:     */
  90. /* include "Views.rsrc" 'view';                                                  */
  91.  
  92.  
  93. /* ================================   Menus   ================================== */
  94.  
  95. resource 'cmnu' (mApple) {
  96.     1,
  97.     textMenuProc,
  98.     0x7FFFFFFD,
  99.     enabled,
  100.     apple,
  101.      {
  102.     /* [1] */    "About IconEdit…",    noIcon,    noKey,    noMark,    plain,    cAboutApp;
  103.     /* [2] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand
  104.     }
  105. };
  106.  
  107.  
  108. /* ------------------------------------------------------------------------------ */
  109.  
  110. resource 'cmnu' (mFile) {
  111.     2,
  112.     textMenuProc,
  113.     allEnabled,
  114.     enabled,
  115.     "File",
  116.      {
  117.     /* [1] */    "New",                noIcon,    "N",    noMark,    plain,    cNew;
  118.     /* [2] */    "Open…",            noIcon,    "O",    noMark,    plain,    cOpen;
  119.     /* [3] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand;
  120.     /* [4] */    "Close",            noIcon,    noKey,    noMark,    plain,    cClose;
  121.     /* [5] */    "Save",                noIcon,    noKey,    noMark,    plain,    cSave;
  122.     /* [6] */    "Save As…",            noIcon,    noKey,    noMark,    plain,    cSaveAs;
  123.     /* [7] */    "Revert to Saved",    noIcon,    noKey,    noMark,    plain,    cRevert;
  124.     /* [8] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand;
  125.     /* [9] */    "Page Setup…",        noIcon,    noKey,    noMark,    plain,    cPageSetup;
  126.     /* [10] */    "Print…",            noIcon,    noKey,    noMark,    plain,    cPrint;
  127.     /* [11] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand;
  128.     /* [12] */    "Quit",                noIcon,    "Q",    noMark,    plain,    cQuit
  129.     }
  130. };
  131.  
  132.  
  133. /* ------------------------------------------------------------------------------ */
  134.  
  135. resource 'cmnu' (mEdit) {
  136.     3,
  137.     textMenuProc,
  138.     allEnabled,
  139.     enabled,
  140.     "Edit",
  141.      {
  142.     /* [1] */    "Undo",                noIcon,    "Z",    noMark,    plain,    cUndo;
  143.     /* [2] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand;
  144.     /* [3] */    "Cut",                noIcon,    "X",    noMark,    plain,    cCut;
  145.     /* [4] */    "Copy",                noIcon,    "C",    noMark,    plain,    cCopy;
  146.     /* [5] */    "Paste",            noIcon,    "V",    noMark,    plain,    cPaste;
  147.     /* [6] */    "Clear",            noIcon,    noKey,    noMark,    plain,    cClear;
  148.     /* [7] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand;
  149.     /* [8] */    "Show Clipboard",    noIcon,    noKey,    noMark,    plain,    cShowClipboard
  150.     }
  151. };
  152.  
  153.  
  154. /* ------------------------------------------------------------------------------ */
  155.  
  156. resource 'cmnu' (mBuzzWords) {
  157.     mBuzzWords,
  158.     textMenuProc,
  159.     allEnabled,
  160.     enabled,
  161.     "Buzzwords",
  162.      {
  163.     /* [1] */    "Page Setup Change", noIcon, noKey, noMark, plain, cChangePrinterStyle
  164.     }
  165. };
  166.  
  167.  
  168. /* ------------------------------------------------------------------------------ */
  169.  
  170. resource 'MBAR' (128) { {mApple; mFile; mEdit} };
  171.